% 内生、外生变量声明
var c k;
varexo A;
parameters beta delta theta;
beta = 0.98;
delta = 0.1;
theta = 0.36;

external_function(name = fsolve, nargs = 2,first_deriv_provided, second_deriv_provided);


model;
k = A*k(-1)^theta -c + (1-delta)*k(-1);
c(1)/c = beta*(A*theta*k^(theta-1)+1-delta);
end;

initval;
k = 6;
c =  6^theta - delta*6;
A = 1;
end;

steady;
resid;

shocks;
var A;stderr 0.01;
end;
stoch_simul(periods = 50,order=2,drop=10);

% shocks;
% var A;
% periods 1:3;
% values 1.2;
% end;
% 
% simul(periods = 3);